<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* 登录弹窗 */
    .login-mask {
      position: fixed;
      top: 0;
      right: 0;
      left: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.4);
      z-index: 99999;
      animation-name: fadeIn;
      animation-duration: .5s
    }

    .login {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      padding: .35rem .1rem 0;
      border-radius: .1rem .1rem 0 0;
      background-color: #fff;
      animation-name: slideIn;
      animation-duration: .5s
    }

    .login-title {
      margin: 0 0 0 2.55rem;
      color: #333333;
      font-size: 0.3rem;
      font-weight: 700;
    }

    .login-close {
      display: inline-block;
      margin-left: 1.8rem;
      font-size: 0.42rem;
      font-weight: 700;
      color: #666666;
    }

    .login img {
      display: block;
      margin: 0.72rem auto .8rem;
      width: 1.6rem;
    }

    .xieyi {
      position: relative;
      width: 3.3rem;
      margin: 0 auto .43rem;
      font-size: 0.24rem;
      font-weight: 500;
      color: #888888;
    }

    .xieyi a {
      color: #FE6600;
    }

    input[type="checkbox"i] {
      margin: 0.02rem .2rem 0 0;
      width: .3rem;
      border-radius: 50% !important;
    }

    .login-btn {
      padding: .21rem 0;
      margin: 0 .78rem .47rem;
      background-color: #FE6600;
      border-radius: 0.1rem;
      font-size: 0.3rem;
      font-weight: 700;
      color: #FFFFFF;
      text-align: center;
    }

    .login-tips {
      margin: 0 0 .45rem 0;
      font-size: 0.24rem;
      font-weight: 400;
      color: #888888;
      text-align: center;
    }

    @keyframes fadeIn {
      from {
        opacity: 0
      }

      to {
        opacity: 1
      }
    }

    @keyframes slideIn {
      from {
        bottom: -6.75rem;
        opacity: 0
      }

      to {
        bottom: 0;
        opacity: 1
      }
    }

    .xieyi-tips {
      position: absolute;
      left: 0.2rem;
      border-radius: .1rem;
      top: -1rem;
      padding: .14rem;
      background-color: rgba(26, 26, 27, 0.6);
      color: #FBFBFB;
    }
  </style>
</head>

<body>
  <a href="http://localhost:8080#/?id=10">asdasdasda</a>
  <!-- 登录弹窗 -->
  <div style="display: none;" class="login-mask display">

    <div class="login">
      <div class="login-title">
        登录体验更多功能
        <span class="login-close">×</span>
      </div>
      <img src="./resource/images/login-photo.svg" alt="">
      <div class="xieyi flex align-center">
        <div class="xieyi-tips display">请阅读并勾选下方协议</div>
        <label class="flex align-center" for="agree"><input id="agree" class="check-box" type="checkbox">
          同意<a href="#">隐私协议</a>和<a href="#">用户协议</a></label>
      </div>
      <div class="login-btn">微信登录</div>
      <div class="login-tips">
        登录后我们能及时为您发送消息提醒通知
      </div>
    </div>
  </div>
  <script>
    if (isWeiXin()) {
      let clickType = 0;
      /**
     * 登录框弹出
     */
      $(".login-up").click(function () {
        clickType = 1;
        $(".login-mask").css("display", "block");
      })
      $(".back_to_feed").click(function () {
        clickType = 2;
        $(".login-mask").css("display", "block");
      })
      $(".login-close").click(function () {
        $("login").removeClass("login-show");
      })

      // 登录按钮
      $(".login-btn").click(function () {
        let checks = $(".check-box").prop("checked"); // 判断是否勾选协议
        if (checks) {
          // 允许登录
          if (clickType == 1) {
            // 为1时 来自登录按钮的触发
            
          } else if (clickType == 2) {
            // 为2时 来自反馈按钮的触发

          }
        } else {
          // 请勾选协议
          $(".xieyi-tips").show();
          setTimeout(() => {
            $(".xieyi-tips").hide();
          }, 2000)
        }
      })

      /**
       * 关闭登录框
       */
      $(".login-close").click(function () {
        $(".login-mask").css("display", "none")
      })

      $(".login-mask").click(function () {
        $(".login-mask").css("display", "none")
      })

      $(".login").click(function (e) {
        e.stopPropagation();
      })

      
    } else {
      $(".back_to_feed").click(function () {
        window.location.href = "http://u.bendibao.com/fankui/m/index.html"
      })
    }

  </script>
</body>

</html>